一些小發現

  • 合計是用在69-96年間分類
  • 地區是用在97年之後的分類
  • 76年解嚴,出國人數上升
  • 香港、澳門、中國分開算
    • 香港很重要
  • SARS與旅遊人數
  • H1N1對旅遊無明顯影響效果
tour <- read_csv("tour.csv", col_names = FALSE) %>%
    rename("Year"=X1,"Location"=X2,"Count"=X3)

合計地區統一為地區

lo<- function(x) {str_replace_all(x,"合計","地區")}
tour <- tour %>%
    mutate(Location=lo(Location))

各大洲比較

## 各大洲旅遊人數
tour_continent <- tour %>%
    filter(grepl("地區",Location)) %>%
    filter(!grepl("其他地區",Location))

## 各大洲旅遊人數比較
ggplot(tour_continent,mapping = aes(x=Year, y=Count))+
    geom_point(mapping = aes(color=Location))+
    scale_x_continuous(breaks=69:104)

各大洲+總人數

## 旅遊總人數
non_region <- tour %>%
    filter(!grepl("地區",Location)) 

other_region <- tour %>%
    filter(grepl("其他地區",Location))

tour_total <- bind_rows(non_region, other_region) %>%
    group_by(Year) %>%
    summarise(Total=sum(Count,na.rm = TRUE))

## 各大洲+總人數
ggplot()+
    geom_line(data=tour_continent,mapping = aes(x=Year,y=Count,color=Location))+
    geom_line(data=tour_total, mapping=aes(x=Year,y=Total,color="總人數"))+
    scale_x_continuous(limits=c(75,104),breaks=75:104)

亞洲: SARS

92年觀光人數下降,亞洲尤其明顯,所以先看看亞洲

tour_asia_country <- tour %>%
    filter(grepl("中國|日本|韓國|香港|亞洲地區|菲律賓|新加坡|馬來西亞|泰國|印尼|汶萊|越南|澳門|緬甸",Location))

gp=ggplot(tour_asia_country,mapping = aes(x=Year, y=Count))+
    geom_line(mapping = aes(color=Location))+
    scale_x_continuous(limits=c(75,104) ,breaks=75:104)+
    scale_y_continuous(breaks=seq(0, 12000000, by=1000000))
ggplotly(gp)

此圖為互動式,可多試試右上角的功能鍵

概觀

  • 香港97年之前的變動趨勢與亞洲地區吻合
  • 中國日本香港98年之後的變動很有趣
  • 92年附近,澳門和香港的曲線變動非常類似,92年的下跌非常明顯

推測這下跌應與某大事件的發生有關。查詢維基百科2003年臺灣,發現其很有可能與SARS於亞洲地區,特別是臺灣與中國大陸的爆發有關。

SARS 疫情

  • 民國92年旅遊人數明顯下降,可說是暴跌的程度。其原因應與SARS在中國大陸、香港、澳門及臺灣的爆發有關。

  • 有趣的是,亞洲國家當中,唯一旅遊人數大幅上升的國家韓國,未傳出SARS疫情(沒有病例)
  • 觀光局觀光統計月報: 2003年4月中華民國國民出國目的地人數分析統計可看到四月份觀光成長率多為負,尤其是香港
    • 三、四月: SARS在香港爆發

綜上所述,應能確定造成92年旅遊人數下降的因素為SARS疫情爆發

亞洲: H1N1

source('./analysis_code/monthly_h1n1_tour.R')

- 上圖: H1N1按月案例數;下圖: 台灣出國旅遊人數 - 與SARS不同,H1N1對於旅遊似乎沒有影響 -嚴重疫區: 中國、韓國、日本

國際航線

下圖依據2012年世界航線的資料繪製

目的地為香港之國際航線

library(readr)
library(maps)
library(geosphere)
library(dplyr)
library(stringr)
library(stringi)
rp <- function(x, origin, replace) {stri_replace_all_fixed(x,origin,replace)}

airports <- read_csv("./data/global_airline_network/airports_with_continent.csv")

routes <- read_csv("./data/global_airline_network/routes.csv") %>%
    mutate("Source airport ID"=rp(`Source airport ID`,"\\N",NA)) %>%
    arrange(desc(`Source airport ID`)) %>%
    filter(is.na(`Source airport ID`)==F)

## filter specific airports
Inter_airport <- airports %>%
    arrange(desc(`Airport ID`)) %>%
    filter(is.na(`Airport ID`)==F) %>%
    filter(str_detect(Name, "International Airport|international airport"))

Dest_HK <- routes[routes$`Destination airport ID`=="3077",]

## Originate: HK airport
xlim <- c(-30, 150)
ylim <- c(-60, 85)
map("world", col="#f2f2f2", fill=TRUE, bg="white", lwd=0.01, mar = c(0.5,.5,.5,.5), ylim=ylim)
for (i in 1:nrow(Dest_HK)) {
    if (Dest_HK[i,]$`Source airport ID` %in% Inter_airport$`Airport ID` & Dest_HK[i,]$`Destination airport ID` %in% airports$`Airport ID`) {
        source_air <- Inter_airport[Inter_airport$`Airport ID`==Dest_HK[i,]$`Source airport ID`,]
        dest_air <- airports[airports$`Airport ID`==Dest_HK[i,]$`Destination airport ID`,]
        
        inter <- gcIntermediate(c(source_air[1,]$Longitude, source_air[1,]$Latitude), c(dest_air[1,]$Longitude, dest_air[1,]$Latitude), n=100, addStartEnd=TRUE)
        lines(inter, col="green", lwd=0.001)
    }
}

高畫質版

與 Master Card 資料結合?

依據以上方式,應可將目的地為Master card上之城市的航線繪製出來,看看有什麼發現。

限制: - 此資料僅有航線,並無總載客量 - 此資料僅2012年

R Script

所有程式碼